<template>
	<view class="container">
		<u-popup
			:show="show"
			closeable
			:round="10"
			mode="center"
			:safeAreaInsetBottom="false"
			@close="close"
		>
			<view class="main">
				<view class="title">{{title}}</view>
				<scroll-view scroll-y="true" style="width: 100%; max-height: 500rpx;">
					<view class="desc">{{content}}</view>
				</scroll-view>
				<button class="enter" :style="{background: templateConfig.page.themeColor}" @click="close">确定</button>
			</view>
		</u-popup>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				templateConfig: uni.getStorageSync('templateConfig'),
				show: false,
				title: '',
				content: ''
			};
		},
		methods: {
			open (params) {
				this.title = params.title;
				this.content = params.content;
				this.show = true;
			},
			close () {
				this.show = false;
			}
		}
	}
</script>

<style scoped lang="scss">
	.container{
		
		.main{
			width: 540rpx;
			border-radius: 20rpx;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			align-items: center;
			padding: 0 30rpx 40rpx 30rpx;
			
			.title{
				padding: 40rpx 0;
				font-size: 34rpx;
				text-align: center;
				margin-top: 20rpx;
			}
			.desc{
				font-size: 28rpx;
				text-align: center;
				color: #5b5b5b;
			}
			.enter{
				width: 200rpx;
				height: 60rpx;
				line-height: 60rpx;
				font-size: 28rpx;
				margin-top: 80rpx;
				color: #fff;
			}
			.enter::after{
				border: none;
			}
		}
	}
</style>